#ifndef RINGBUFFER_GLOBAL_H
#define RINGBUFFER_GLOBAL_H

#if defined(_MSC_VER) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define Q_DECL_EXPORT __declspec(dllexport)
#define Q_DECL_IMPORT __declspec(dllimport)
#else
#define Q_DECL_EXPORT __attribute__((visibility("default")))
#define Q_DECL_IMPORT __attribute__((visibility("default")))
#endif

#if defined(RINGBUFFER_LIBRARY)
#define RINGBUFFER_EXPORT Q_DECL_EXPORT
#else
#define RINGBUFFER_EXPORT Q_DECL_IMPORT
#endif

class RINGBUFFER_EXPORT RingBuffer
{
public:
    virtual bool PushData(unsigned char *data, unsigned long long datalen) = 0;
    virtual unsigned int PopData(unsigned char *data, unsigned long long datalen) = 0;
    virtual unsigned long long PeekData(unsigned char *data, unsigned long long datalen) = 0;
	virtual ~RingBuffer();
};

class RINGBUFFER_EXPORT RingBufferCreator
{
public:
    RingBuffer *Generate(unsigned int len);
    void Destroy(RingBuffer *);
};

#endif // RINGBUFFER_GLOBAL_H
